package com.cy.personer.biz.impl;

import com.cy.personer.bean.Item;
import com.cy.personer.biz.ItemBiz;
import com.cy.personer.ceptor.OperationLog;
import com.cy.personer.mapper.ItemMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class ItemBizIpml implements ItemBiz {
    @Resource
    private ItemMapper itemMapper;

    @Override
    @OperationLog(operType="查询",methods = "查询所有项目" )
    public PageInfo<Item> findAllItem(Item item,int pageNum,int pageSize) {
        Page<Item> page=PageHelper.startPage(pageNum,pageSize);
        itemMapper.findAllItem(item);
        PageInfo<Item> pageInfo=new PageInfo<Item>(page);
        return pageInfo;
    }

    @Override
    @OperationLog(operType="添加",methods = "添加项目" )
    public int addItem(Item item) {
        return itemMapper.addItem(item);
    }

    public ItemMapper getItemMapper() {
        return itemMapper;
    }

    public void setItemMapper(ItemMapper itemMapper) {
        this.itemMapper = itemMapper;
    }
}
